## -*- coding: utf-8 -*-

import sys
import webapp2
import DB.Auto_Loader
from google.appengine.ext.webapp import util
from controllers import login,ajax,mainh,optimizerMockSolver
from DB import Auto_Loader

# This is the main method that maps the URLs
# of bid-it application with the controller classes.
# If a URL is requested that is not listed here,
# a 404 error is displayed.

sys.path.insert(0, 'libs')
application = webapp2.WSGIApplication([
        ('/', mainh.MainHandler),
        ('/login/', login.userLogin),
        ('/ajax/faculties-list/', ajax.getFaculties),
        ('/ajax/courses-list-by-fac/', ajax.getCoursesListByFaculty),
        ('/ajax/chosen-courses-info/', ajax.getChosenCoursesInformation),
        ('/ajax/course-profile-info/', ajax.getCourseProfileInfo),
        ('/ajax/get-syllabus/',ajax.DownloadParseUrl),
        ('/ajax/optimizer/', ajax.getOptimizedSchedule),
        ('/ajax/get-autoComplete-courses/', ajax.getAllCoursesOfSemester),
        ('/ajax/saveUserData/', ajax.saveUserScheduleData),
        ('/ajax/loadUserData/', ajax.loadUserScheduleData),
        ('/ajax/submitMail/', ajax.submitSupportMail),
        ('/ajax/save-facebook-id/', ajax.saveFacebookId),
        ('/ajax/get-friends-by-course/', ajax.getFacebookFriendsByCourse),
        ('/ajax/get-friend-chosen-courses/', ajax.getFacrbookFriendChosenCourses),
        ('/ajax/getOldExamsLinks/',ajax.getOldExamsLinks),
        ('/ajax/saveEventLinksToDS/',ajax.saveNewEvents),
        ('/database/automatic-DB-update/',Auto_Loader.load),
        ('/blabla',Auto_Loader.load)],
        debug=True)

def main():
    util.run_wsgi_app(application)
    
if __name__ == '__main__':
    main()

